package com.blabla.service.impl;

import com.blabla.factory.CalculationBeanFactory;
import com.blabla.service.process.CalculationProcess;
import com.blabla.request.CalculationRequest;
import com.blabla.service.CalculationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author yzw
 * @date 2022/1/15 10:55
 * @desc
 */
@Service
@Slf4j
public class CalculationServiceImpl implements CalculationService {
    @Override
    public Integer calculate(CalculationRequest request) {
        CalculationProcess calculationProcess = CalculationBeanFactory.getCalculationProcess(request.getOption());
        return calculationProcess.calculationEasy(request.getFirstNum(), request.getSecondNum());

    }
}
